function dateValidation(fromDate, toDate) {

	if (fromDate != '' && toDate != '') {
		var FromDate = new Date(fromDate);
		var ToDate = new Date(toDate);

		if (FromDate > ToDate) {
			alert('From Date should be less than To Date!');
			return false;
		}
	}

	return true;
}

function scoreValidation(fromScore, toScore) {
	try {
		if (fromScore != '' && toScore != '') {
			var fromScore = parseInt(fromScore, 10);
			var toScore = parseInt(toScore, 10);
			if (isNaN(fromScore) || fromScore < 0 || fromScore > 100) {
				var msg = "Exam Score >= is not valid!";
				var err = new Error(msg);
				if (!err.message) {
					err.message = msg;
				}
				throw err;
			}
			if (isNaN(toScore) || toScore < 0 || toScore > 100) {
				var msg = "To Score is not valid!";
				var err = new Error(msg);
				if (!err.message) {
					err.message = msg;
				}
				throw err;
			}
			if (fromScore > toScore) {
				alert('Exam Score >= is bigger than Exam Score <=!');
				return false;
			}
		}
		if (fromScore != '' && toScore == '') {
			var fromScore = parseInt(fromScore, 10);
			if (isNaN(fromScore) || fromScore < 0 || fromScore > 100 ) {
				var msg = "Exam Score >= is not valid!";
				var err = new Error(msg);
				if (!err.message) {
					err.message = msg;
				}
				throw err;
			}
		}
		if (fromScore == '' && toScore != '') {
			var toScore = parseInt(toScore, 10);
			if (isNaN(toScore) || toScore < 0 || toScore > 100 ) {
				var msg = "Exam Score <= is not valid!";
				var err = new Error(msg);
				if (!err.message) {
					err.message = msg;
				}
				throw err;
			}
		}
	} catch (e) {
		alert(e.message);
		return false;
	}
	return true;
}
